Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: FFmpeg/FFV1
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3c896745bc8b
Choose a base ref
...
head repository: FFmpeg/FFV1
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 69a377ca2910
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Jan 7, 2017

  1. define abs log2 min functions

    partly resolves #36
    dericed committed Jan 7, 2017
    Copy the full SHA
    09ab181 View commit details
  2. add missing a*=b function

    dericed committed Jan 7, 2017
    Copy the full SHA
    69a377c View commit details
Showing with 15 additions and 6 deletions.
  1. +15 −6 ffv1.md
21 changes: 15 additions & 6 deletions ffv1.md
Original file line number Diff line number Diff line change
@@ -66,6 +66,8 @@ Note: the operators and the order of precedence are the same as used in the C pr
`a += b` is equivalent to a is assigned a + b.

`a -= b` is equivalent to a is assigned a - b.

`a *= b` is equivalent to a is assigned a * b.
--------------- ----------------------------------------------------------------

### Comparison operators
@@ -96,7 +98,14 @@ Note: the operators and the order of precedence are the same as used in the C pr

--------------------- -----------------------------------------------
$$\lfloor a \rfloor$$ the largest integer less than or equal to a

$$\lceil a \rceil$$ the smallest integer greater than or equal to a

abs(a) the absolute value of a, i.e. abs(a) = sign(a)*a

log2(a) the base-two logarithm of a

min(a,b) the smallest of two values a and b
--------------------- -----------------------------------------------

### Order of operation precedence
@@ -116,7 +125,7 @@ a | b
a && b
a || b
a ? b : c
a = b, a += b, a -= b
a = b, a += b, a -= b, a *= b
```

### Range
@@ -266,18 +275,18 @@ is_signed) { |
    int i; |
    put_rac(c, state+0, !v); |
    if (v) { |
        int a= ABS(v); |
        int a= abs(v); |
        int e= log2(a); |
|
        for (i=0; i<e; i++) |
            put_rac(c, state+1+MIN(i,9), 1);  //1..10 |
            put_rac(c, state+1+min(i,9), 1);  //1..10 |
|
        put_rac(c, state+1+MIN(i,9), 0); |
        put_rac(c, state+1+min(i,9), 0); |
        for (i=e-1; i>=0; i--) |
            put_rac(c, state+22+MIN(i,9), (a>>i)&1); //22..31 |
            put_rac(c, state+22+min(i,9), (a>>i)&1); //22..31 |
|
        if (is_signed) |
            put_rac(c, state+11 + MIN(e, 10), v < 0); //11..21|
            put_rac(c, state+11 + min(e, 10), v < 0); //11..21|
    } |
} |
```